<ui:composition xmlns="http://www.w3.org/1999/xhtml"
				xmlns:h="http://java.sun.com/jsf/html"
				xmlns:f="http://java.sun.com/jsf/core"
				xmlns:c="http://java.sun.com/jstl/core"
				xmlns:ui="http://java.sun.com/jsf/facelets"
				xmlns:fn="http://java.sun.com/jsp/jstl/functions">
	<h:form>
		<div style="text-align:right;margin-bottom:8px;">
			<div style="float:left;">
				<!-- Paging -->	
				<ui:include src="/snippets/paging.xhtml">
				     <ui:param name="currentCrud" value="#{noteCrud}"/>
				</ui:include>			
			</div>
			
			<!-- Search Widget -->	
			<ui:include src="/search/searchBox.xhtml">
			     <ui:param name="crud" value="#{noteCrud}"/>
			</ui:include>			
			
		</div>        
       
        <div>
			<h:outputText escape="false" value="#{msg.noteEmpty}" rendered="#{noteCrud.pager.totalCount == 0}" />
            <h:panelGroup rendered="#{fn:length(noteCrud.pagedItems) > 0}">
            	<h:dataTable value="#{noteCrud.pagedItems}" var="item"
                               width="100%" columnClasses="center,center,center,width3">
                	<h:column headerClass="width1">
                    	<f:facet name="header">
                        	<h:outputText value="#{msg.noteDescription}" />
                        </f:facet>
                        <h:outputText value="#{item.description}" />
                    </h:column>
                    <h:column headerClass="width1">
                    	<f:facet name="header">
                        	<h:outputText value="#{msg.noteObservationDate}" />
                        </f:facet>
                        <h:outputText value="#{item.observationDate}" converter="#{calendarConverter}" />
                    </h:column>
                    <h:column headerClass="width1">
                    	<f:facet name="header">
                        	<h:outputText value="#{msg.dataStatus}" />
                        </f:facet>
                        <h:outputText value="#{item.status}" />
                    </h:column>
                    <h:column headerClass="width3">
                        <f:facet name="header">
                            <h:outputText escape="false" value=""/>
                        </f:facet>
                          
                        <h:commandLink immediate="true" action="#{noteCrud.detailSetup}">
                        	<h:graphicImage title="view" style="border: 0;" value="/resources/icons/details.ico"/>
                            <f:param name="itemId" value="#{item.uuid}"/>
                        </h:commandLink>
                        <h:commandLink  action="#{noteCrud.editSetup}">
                        	<h:graphicImage title="edit" style="border: 0;" value="/resources/icons/edit.ico"/>
                        	<f:param name="itemId" value="#{item.uuid}"/>
                    	</h:commandLink>
                    	<h:commandLink  action="#{noteCrud.delete}">
                        	<h:graphicImage title="delete" style="border: 0;" value="/resources/icons/delete.ico"/>
                        	<f:param name="itemId" value="#{item.uuid}"/>
                    	</h:commandLink>
                    </h:column>
                </h:dataTable>
        	</h:panelGroup>
    	</div>
	</h:form>
</ui:composition>